<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<html>
	<head>
		<title>订单来源平台配置</title>
		<script type="text/javascript">
		$(function(){
			var datatable_content = $("#contentTable").dataTable({
			   "bServerSide":true,
	           "sAjaxSource":'${ctx}/ordenoSource/page',
	           "fnServerData": callback,
	           "bFilter": false,
	           "bSort": false,
	           "sZeroRecords": "查询无记录！",
	           "bProcessing": true,
	           "oLanguage": {
	               "sUrl": '${ctx}/static/v2/js/plugins/datatables/cn.txt'
	            },
	             "aoColumns":[
	             	 {"mData": "ordenoSourceName"},
	             	 {"mData": "ordenoSourceCode"},
	             	 {"mData": "modifyDate"},
	             	 {"mData": "id"}
	             ],
	             "aoColumnDefs":[
		             {"aTargets": [2],
		               "mRender": function (data, display, row) {
			        	return new Date(data.time).Format("yyyy-MM-dd hh:mm:ss");
			           }
		             },
		             {"aTargets": [3],
		               "mRender": function (data, display, row) {
			        	return "<a href='${ctx }/ordenoSource/v2_update/"+data+"' class='btn btn-primary'>更新</a>";
			           }
		             }
	             ],
			});
		});
		function callback( sSource, aoData, fnCallback ) {
			 //查询参数
		   $.ajax({ 
		       "type": "post",
		       "contentType": "application/json", 
		       "url": sSource,    
		       "dataType": "json",   
		       "data": JSON.stringify(aoData),
		       "success": fnCallback
		   });    
		}
		</script>
	</head>

	<body>
	<section class="content">
		<div class="row">
		<div class="col-md-12">
		<c:if test="${not empty message}">
			<div id="message" class="alert alert-success">
				<button data-dismiss="alert" class="close">
					×
				</button>
				${message}
			</div>
		</c:if>

		<div>
			<a class="btn btn-info" href="${ctx}/ordenoSource/v2_create">增加来源平台</a>
		</div>
		<br>
		</div>
		</div>
		
		<div class="form-group row">
		<div class="col-md-12">
		<div class="box box-solid box-primary">
				<div class="box-header">
					<i class="fa fa-list"></i>
					<h3 class="box-title">查询结果</h3>
					<div class="box-tools pull-right">
						<button class="btn btn-primary btn-sm" data-widget="collapse">
							<i class="fa fa-minus"></i>
						</button>
					</div>
				</div>
				<div class="box-body">
		<table id="contentTable"
			class="table table-striped table-bordered table-condensed">
			<thead>
				<tr>
					<th>
						平台名称
					</th>
					<th>
						平台编码
					</th>
                   
					<th>
						最近修改
					</th>
					<th>
						操作
					</th>
				</tr>
			</thead>
			<tbody>
			</tbody>
		</table>
		</div>
		</div>
		</div>
		</div>
	</section>
	</body>
</html>
